<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="教程,">










<meta name="description" content="我们平时所用的不管是单片机，还是其它一些电子器件，根据使用条件的约束，可以分为商业级和工业级，主要是工作温度范围的不同，DS1302 的购买信息如下图 15-4 所示。  图 15-4  DS1302 订购信息  我们在订购 DS1302 的时候，就可以根据图 15-4 所标识的来跟销售厂家沟通，商业级的工作温度范围略窄，是 0～70 摄氏度，而工业级可以工作在零下 40～85 摄氏度。TOP M">
<meta name="keywords" content="教程">
<meta property="og:type" content="article">
<meta property="og:title" content="15.4、DS1302的硬件信息">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2014/12/01/mcu100/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="我们平时所用的不管是单片机，还是其它一些电子器件，根据使用条件的约束，可以分为商业级和工业级，主要是工作温度范围的不同，DS1302 的购买信息如下图 15-4 所示。  图 15-4  DS1302 订购信息  我们在订购 DS1302 的时候，就可以根据图 15-4 所标识的来跟销售厂家沟通，商业级的工作温度范围略窄，是 0～70 摄氏度，而工业级可以工作在零下 40～85 摄氏度。TOP M">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235240W5.png">
<meta property="og:image" content="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235349395.png">
<meta property="og:image" content="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235505I0.png">
<meta property="og:image" content="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235G6125.png">
<meta property="og:image" content="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235P43a.png">
<meta property="og:updated_time" content="2019-01-31T13:12:34.297Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="15.4、DS1302的硬件信息">
<meta name="twitter:description" content="我们平时所用的不管是单片机，还是其它一些电子器件，根据使用条件的约束，可以分为商业级和工业级，主要是工作温度范围的不同，DS1302 的购买信息如下图 15-4 所示。  图 15-4  DS1302 订购信息  我们在订购 DS1302 的时候，就可以根据图 15-4 所标识的来跟销售厂家沟通，商业级的工作温度范围略窄，是 0～70 摄氏度，而工业级可以工作在零下 40～85 摄氏度。TOP M">
<meta name="twitter:image" content="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235240W5.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2014/12/01/mcu100/">





  <title>15.4、DS1302的硬件信息 | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2014/12/01/mcu100/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">15.4、DS1302的硬件信息</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2014-12-01T20:41:00+08:00">
                2014-12-01
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/单片机教程/" itemprop="url" rel="index">
                    <span itemprop="name">单片机教程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>我们平时所用的不管是单片机，还是其它一些电子器件，根据使用条件的约束，可以分为商业级和工业级，主要是工作温度范围的不同，DS1302 的购买信息如下图 15-4 所示。</p>
<p><img src="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235240W5.png" alt></p>
<center><strong>图 15-4  DS1302 订购信息</strong></center>

<p>我们在订购 DS1302 的时候，就可以根据图 15-4 所标识的来跟销售厂家沟通，商业级的工作温度范围略窄，是 0～70 摄氏度，而工业级可以工作在零下 40～85 摄氏度。TOP MARK就是指在芯片上印的字。</p>
<p>DS1302 一共有 8 个引脚，下边要根据引脚分布图和典型电路图来介绍一下每个引脚的功能，如图 15-5 和图 15-6 所示。</p>
<p><img src="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235349395.png" alt></p>
<center><strong>图 15-5  DS1302 引脚图</strong></center>

<p><img src="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235505I0.png" alt></p>
<center><strong>图 15 -6  DS1302典型电路</strong></center>

<p>1 脚 VCC2 是主电源正极的引脚，2 脚 X1 和 3 脚 X2 是晶振输入和输出引脚，4 脚 GND是负极，5 脚 CE 是使能引脚，接单片机的 IO 口，6 脚 I/O 是数据传输引脚，接单片机的 IO口，7 脚 SCLK 是通信时钟引脚，接单片机的 IO 口，8 脚 VCC1 是备用电源引脚。考虑到KST-51 开发板是一套以学习为目的的板子，加上备用电池对航空运输和携带不方便，所以 8脚没有接备用电池，而是接了一个 10uF 的电容，这个电容就相当于一个电量很小的电池，经过试验测量得出其可以在系统掉电后仍维持 DS1302 运行 1 分钟左右，如果大家想运行时间再长，可以加大电容的容量或者换成备用电池，如果掉电后不需要它再维持运行，也可以干脆悬空，如图 15-7 和图 15-8 所示。<br><img src="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235G6125.png" alt></p>
<center> <strong>图 15-7  DS1302 电容作备用电源</strong> </center>

<p><img src="http://c.biancheng.net/cpp/uploads/allimg/140321/1-140321235P43a.png" alt></p>
<center> <strong>图 15 -8  DS1302无备用电源</strong> </center>

<p>涓流充电功能，基本也用不到，因为实际应用中很少会选择可充电电池作为备用电源，成本太高，本课程也不讲了，大家作为选学即可。我们使用的时候直接用 5V 电源接一个二极管，在主电源上电的情况下给电容充电，在主电源掉电的情况下，二极管可以防止电容向主电路放电，而仅用来维持 DS1302 的供电，这种电路的最大用处是在电池供电系统中更换主电池的时候保持实时时钟的运行不中断，1 分钟的时间对于更换电池足够了。此外，通过我们的使用经验，在 DS1302 的主电源引脚串联一个 1K 电阻可以有效的防止电源对 DS1302的冲击，R6 就是这个电阻，而 R9、R26、R32 都是上拉电阻。</p>
<p>我们把 8 个引脚功能分别介绍，如表 15-1 所示。</p>
<p><strong>表 15-1 DS1302 引脚功能图</strong></p>
<table><tr><th>引脚编号</th><th>引脚名称</th><th>引脚功能</th></tr><tr><td>1</td><td>Vcc2</td><td>主电源引脚，当&nbsp;Vcc2&nbsp;比&nbsp;Vcc1&nbsp;高&nbsp;0.2V&nbsp;以上时，DS1302&nbsp;由&nbsp;Vcc2<br>供电，当&nbsp;Vcc2&nbsp;低于&nbsp;Vcc1&nbsp;时，由&nbsp;Vcc1&nbsp;供电。</td></tr><tr><td>2</td><td>X1</td><td rowspan="2">这两个引脚需要接一个&nbsp;32.768K&nbsp;的晶振，给&nbsp;DS1302&nbsp;提供一个基<br>准。特别注意，要求这个晶振的引脚负载电容必须是&nbsp;6pF，而不<br>是要加&nbsp;6pF&nbsp;的电容。如果使用有源晶振的话，接到&nbsp;X1&nbsp;上即可，<br>X2&nbsp;悬空。</td></tr><tr><td>3</td><td>X2</td></tr><tr><td>4</td><td>GND</td><td>接地。</td></tr><tr><td>5</td><td>CE</td><td>DS1302&nbsp;的使能输入引脚。当读写&nbsp;DS1302&nbsp;的时候，这个引脚必须<br>是高电平，DS1302&nbsp;这个引脚内部有一个&nbsp;40k&nbsp;的下拉电阻。</td></tr><tr><td>6</td><td>I/O</td><td>这个引脚是一个双向通信引脚，读写数据都是通过这个引脚完成。<br>DS1302&nbsp;这个引脚的内部含有一个&nbsp;40k&nbsp;的下拉电阻。</td></tr><tr><td>7</td><td>SCLK</td><td>输入引脚。SCLK&nbsp;是用来作为通信的时钟信号。DS1302&nbsp;这个引脚<br>的内部含有一个&nbsp;40k&nbsp;的下拉电阻。</td></tr><tr><td>8</td><td>Vcc1</td><td>备用电源引脚。</td></tr></table>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/教程/" rel="tag"># 教程</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2014/12/01/mcu099/" rel="next" title="15.3、实时时钟芯片DS1302介绍">
                <i class="fa fa-chevron-left"></i> 15.3、实时时钟芯片DS1302介绍
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2014/12/01/mcu101/" rel="prev" title="15.5、DS1302寄存器介绍">
                15.5、DS1302寄存器介绍 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
